package br.com.stefanini.schs.util;


public final class Utilitario {
	
	private Utilitario() {}
	
	public static boolean isNullOrEmpty(String str) {
		return (isNull(str) || "".equals(str.trim()));
	}
	
	public static boolean isNull(Object object) {
		return object == null;
	}
	
	public static boolean isNumeric(String str) {
		if (isNullOrEmpty(str)) {
			return false;
		}

		int sz = str.length();
		for (int i = 0; i < sz; i++) {
			if (!Character.isDigit(str.charAt(i))) {
				return false;
			}
		}
		
		return true;
	}
	
	public static String retiraMascara(String str) {

		String strLocal = str;
		if (!isNullOrEmpty(strLocal)) {

			strLocal = strLocal.replaceAll("\\.|-", "");
			strLocal = strLocal.replaceAll("\\/", ".");
		}

		return strLocal;
	}


}